import { HashRouter as Router, Switch, Route, Redirect } from 'react-router-dom'
import App from '../App'
import Home from '../views/Home'
import Fast from '../views/Fast'
import User from '../views/User'
import Login from '@/views/Login'
import Reg from '@/views/Reg'
import Sub from '@/views/Sub'
import SelectQuestion from '@/views/SelectQuestion'
import Practice from '@/views/Practice'
import FastItem from '@/views/FastItem'
const BaseRouter = () => {
    return (
        <Router>
            <Switch>
                <Route path="/" component={() => {
                    return <App>
                        <Switch>
                            <Route exact path="/home" component={Home}></Route>
                            <Route exact path="/fast" component={Fast}></Route>
                            <Route exact path="/user" component={User}></Route>
                            <Route exact path="/sub" component={Sub}></Route>
                            <Route exact path="/selectQuestion/:actionCode" component={SelectQuestion}></Route>
                            <Route exact path="/practice" component={Practice}></Route>
                            <Route exact path="/fastItem" component={FastItem}></Route>
                            <Route path="/login" component={Login}></Route>
                            <Route path="/reg" component={Reg}></Route>
                            <Redirect to="/home"></Redirect>
                        </Switch>
                    </App>
                }}></Route>
            </Switch>
        </Router>
    )
}

export default BaseRouter